package Util;



public class CoordinateUtil {
	public static int[] isoXTo2DX(int[]pointx,int[]pointy){
		int[] list = new int[pointx.length];
		for(int i=0;i<pointx.length;i++){
			list[i]=isoXTo2DX(pointx[i],pointy[i])+500;
		}
		return list;
	}
	public static  int[] isoYTo2DY(int[]pointx,int[]pointy){
		int[] list = new int[pointx.length];
		for(int i=0;i<pointx.length;i++){
			list[i]=isoYTo2DY(pointx[i],pointy[i]);
		}
		return list;
	}
	public static int isoXTo2DX(int ptx,int pty) {

		int tempPtx = ptx - pty;
		//int tempPtx = ptx;
		return tempPtx;
	}
	public static int isoYTo2DY(int ptx,int pty) {

		int tempPty =(ptx + pty) / 2;
		//int tempPty =pty;
		return tempPty;
	}

	public static int twoDXToIsoX(int ptx,int pty) {
		int tempPtx = (2 * pty + ptx) / 2;
		return tempPtx;
	}
	public static int twoDYToIsoY(int ptx,int pty) {
		int tempPty = (2 * pty - ptx) / 2;
		return tempPty;
	}
}
